<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="login" method="post">
    用户名：<input name="username" th:value="${username}" type="text">
    密码：<input name="password" th:value="${password}"  type="text">
    <button type="submit">登录</button>
</form>
<input type="hidden" id="token"  th:value="${token}">
token：<div th:text="${token}"> </div>
<script>
    var token = window.document.getElementById("token").value;
    console.log(token);
    if(token == ""){
        window.location.href="http://auth.yanxiang.com:8090/oauth/authorize?"+
        "client_id=admin&"+
        "redirect_uri=http://admin.yanxiang.com:8088/oauth/callback&"+
        "response_type=code&"+
        "state=abc";
    }

</script>
</body>
</html>